// Reg.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "windows.h"
#include <winreg.h>

int _tmain(int argc, _TCHAR* argv[])
{
	HKEY keyHandle;
	char rgValue [1024];
	char fnlRes [1024] = "\0";;
	DWORD size1;
	DWORD Type;

	if( RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Kodak",0, KEY_QUERY_VALUE, &keyHandle) == ERROR_SUCCESS)
	{
		size1=1023;
		RegQueryValueEx( keyHandle, L"Productid", NULL, &Type, (LPBYTE)rgValue,&size1);
		sprintf(fnlRes,"Product ID of your Windows system is:: %s\0",rgValue);
	}     
	else strcpy(fnlRes,"Couldn't access system information!\0");

	RegCloseKey(keyHandle);
	printf(fnlRes);
	return 0;
}

